<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateAgentWithdrawRecordsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('agent_withdraw_records', function (Blueprint $table) {
            $table->id();
            $table->unsignedBigInteger('agent_id')->index()->comment('代理商 ID');

            $table->unsignedBigInteger('withdrawal_amount')->comment('提现金额 单位分');
            $table->string('cardholder_name')->comment('持卡人姓名');
            $table->string('cardholder_id_number')->comment('持卡人身份证号');
            $table->string('bank_name')->comment('银行名称');
            $table->string('bank_card_account')->comment('银行卡账号');

            $table->tinyInteger('status')->default(1)->comment('状态; 1:待审核 2:已通过 3:已驳回');
            $table->unsignedBigInteger('operator_id')->default(0)->comment('操作人 ID');
            $table->string('audit_remarks')->default('')->comment('审核备注(意见内容)');

            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('agent_withdraw_records');
    }
}
